﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media;

namespace Sorting.App.Controls
{

    /// <summary>
    /// TOST帮助类
    /// </summary>
    public static  class TostHelper
    {

        /// <summary>
        /// 成功
        /// </summary>
        /// <param name="message"></param>
        public    static void ShowSucess(string   message)
        {
            Toast.Show(@$"{message}", new ToastOptions
            {
                Icon = ToastIcons.Sucess,
                Background = (Brush)new BrushConverter().ConvertFromString("#2ecc71"),
                Location = ToastLocation.ScreenCenter,
                Time = 1000
            });

        }


        /// <summary>
        /// 警告
        /// </summary>
        /// <param name="message"></param>
        public static void ShowWarning (string message)
        {
            Toast.Show(@$"{message}", new ToastOptions
            {
                Icon = ToastIcons.Warning,
                Background = (Brush)new BrushConverter().ConvertFromString("#ff7f50"),
                Location = ToastLocation.ScreenCenter,
                Time = 1000
            });

        }


        /// <summary>
        /// 错误
        /// </summary>
        /// <param name="message"></param>
        public static void ShowError(string message)
        {
            Toast.Show(@$"{message}", new ToastOptions
            {
                Icon = ToastIcons.Error,
                Background = (Brush)new BrushConverter().ConvertFromString("#ff4757"),
                Location = ToastLocation.ScreenCenter,
                Time = 1000
            });

        }




        /// <summary>
        ///信息
        /// </summary>
        /// <param name="message"></param>
        public static void ShowInfo(string message)
        {
            Toast.Show(@$"{message}", new ToastOptions
            {
                Icon = ToastIcons.Information,
                Background = (Brush)new BrushConverter().ConvertFromString("#57606f"),
                Location = ToastLocation.ScreenCenter,
                Time = 1000
            });

        }
    }
}
